//To replicate Hegde, Herkenhoff, and Zhu (2022)
//Obtain access to (1) PATSTAT, (2) PALM Data (via USPTO), (3) Compustat/CRSP
//Obtain supplementary datafiles (e.g., patent-public firm link (obtained from Kogan et al. (2017)); Google word embedding vectors (via BigQuery))
//Place required data files in the working directory
//place the following programs in the current directory and run this file


//define the directory that contains the data
global DATA "C:\Users\..."


do "US9803_PrePost.do" //Figures 3-6, Tables 3, C1-C5
do "US_EP_DID.do" // Figures 7-10, G1, Tables 4-6, 8-10, D2-D7, E1-E2. F1, G1
do "US_JP_DID.do" // Figure D2, Table 7
do "Patenting Intensity.do" //Table 11
do "RD_Analysis.do" //Figure H1, Table 12, H1, H2
do "EP_Foreign parallel applications.do" //Tables 1, D1
do "US_EP equivalence validation.do" //Table D1
do "IPC7-sim validation.do" //Table B1
do "Exclude software patents.do" //Table I1